<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="UTF-8"%>
<%@ page import=" com.sfxy.form.*" %>
<%@ page import="com.sfxy.dao.*" %>
<%
String path = request.getContextPath(); 
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

//返回当前页面所在的应用的名字 /GraduationThesisSystem
//request.getSchema()，返回的是当前连接使用的协议，一般应用返回的是http、SSL返回的是https；
//request.getServerName()，返回当前页面所在的服务器的名字；
//request.getServerPort()，返回当前页面所在的服务器使用的端口；
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>显示论文列表</title>
	<style type="text/css">
    
	<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	
	width:806px; height:600px;
}
body,td,th {
	font-family: 新宋体;
	color: #660000;
}
.STYLE1{
	font-family: "新宋体";
	color: #660033;
	font-size: 12px;
}

-->
    </style>
    </head>
 <jsp:useBean id="pageset" class="com.sfxy.tool.PageSet" scope="session"></jsp:useBean> 
 <jsp:useBean id="suadao" class="com.sfxy.dao.TeacherDao"  scope="session"></jsp:useBean>
 <%
 	int Page=1;
 	int pagesize=15;
    List  list = suadao.queryTeacher();
    list = pageset.getInitPage(list,Page,pagesize);
 	//得到查询到的列表
  %>
  <body>
 <form name="formfomr" method="post" >
 <input type="hidden"  id="jsmessage" name="message"  />
 <table width="794"  border="5" cellpadding="3" cellspacing="1" bordercolor="#660000" background="images/back_r2_c2.jpg" class="STYLE1">
   <tr>
     <td colspan="9" ><%
  		if(pageset.getrecordSize()<=0){
		out.print("<p align=center><img src=images/icon.gif width=10 height=10>&nbsp;&nbsp;<strong>暂时还没有系统题目录入!</strong></p>");}
		else{
		  out.println("<p align=center>&nbsp;&nbsp;&nbsp;&nbsp;<img src=images/icon.gif width=10 height=10>&nbsp;&nbsp;所有题目列表信息!</p>");}
  	 %>
     </td>
   </tr>
   <tr >
     <td width="74" height="30" align="center"><strong>教师编号</strong></td>
     <td width="74" align="center"><strong>教师姓名</strong></td>
     <td width="74" align="center"><strong>职称</strong></td>
     <td width="74" align="center"><strong>电话</strong></td>
     <td width="74" align="center"><strong>辅助教师</strong></td>
     <td width="74" align="center"><strong>助教电话</strong></td>
     <td width="74" align="center"><strong>题目总数</strong></td>
     <td width="74"><strong>是否带毕业生</strong></td>
     <td align="center"><strong>执行操作</strong></td>
   </tr>
   <%
		for(int i=0;i<list.size();i++){
			TeacherForm formb=(TeacherForm)list.get(i);
	 %>
   <tr>
     <td ><%=formb.getTeacherId() %>
         <input type="hidden" name="TeacherId" value="<%=formb.getTeacherId() %>">
     </td>
     <td><%=formb.getName() %></td>
     <td><%=formb.getProfession() %>     </td>
     <td><%=formb.getTelephoneId() %></td>
     <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
     <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
     <td>
         <%
         	int TeacherId=formb.getTeacherId();
         	SubjectDao sdao=new SubjectDao();
         	List sblist=sdao.exqueryTeacherSubject(TeacherId);
         	int sum=sblist.size();
          %>
        <%=sum %> 
     </td>
	 <td> <%=formb.getYN() %></td>
     <td width="50"><input type="button" name="ssss" value="选择" onClick="checkForm(<%=formb.getTeacherId()%>);">
     </td>
	 
   </tr>
   <%} %>
 </table>
 <%=pageset.printCtrl(Page) %>
   
 </form>
  </body>
</html>
<script type="text/javascript" >
      function checkForm(f,v){
      document.getElementById("jsmessage").value=f;
      formfomr.action="RedrectServlet";
      	formfomr.submit();
      }
      </script>
